//
//  GDBarcodeViewController.m
//  GDWeiboNJ
//
//  Created by zhouguodong on 15/4/6.
//  Copyright (c) 2015年 shuanyuan. All rights reserved.
//

#import "GDBarcodeViewController.h"

@interface GDBarcodeViewController ()
///  冲击波的顶部约束
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *Barcode;

@end

@implementation GDBarcodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // 创建定时器
    CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
    // 添加到运行循环
    [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
}

- (void)update
{
    self.Barcode.constant += 2;
    if (self.Barcode.constant >= 120) {
        self.Barcode.constant = -60;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
